const {
    getFirendLink,
    updateFirendLink,
    destroyFirendLink,
    createFirendLink
} = require('../service/firendlink'),
    { returnInfo } = require('../lib/utils'),
    { API } = require('../config/err_config');
class FirendLink{
    async getFirendLink(ctx){
        try {
            const { id } = ctx.request.body;
            let returnMess = await getFirendLink(id);
            ctx.body = returnMess ? returnInfo(API.GET_FIRENDLINK_SUCCESS)
                                  : returnInfo(API.GET_FIRENDLINK_ERROR) 
        } catch (error) {
            console.log(error);
            ctx.body = returnInfo(API.GET_FIRENDLINK_ERROR);
        }
    }
    async createFirendLink(ctx){
        try {
            
        } catch (error) {
            console.log(error);
            ctx.body = returnInfo(API.CREATE_FIRENDLINK_ERROR)
        }
    }
}
module.exports = new FirendLink();    